
import React from 'react';
import { Button, Row, Col } from 'antd';
import { config, routerTool } from 'utils';
import { routerRedux } from 'dva/router';

import styles from './index.less';
import { connect } from "dva";
import { Page } from 'components';
import PropTypes from "prop-types";

class Alert extends React.Component {
  static propTypes = {
    dispatch: PropTypes.func,
  };
  render () {
    const { dispatch } = this.props;
    // 跳转到加入组织
    const join = () => {
      dispatch(routerTool.redirectTo({
        name: "JoinOrganization",
      }));
    };
    // 跳转到创建组织
    const create = () => {
      dispatch(
        routerTool.redirectTo({
          name: "CreateOrganization",
        })
      );
    };
    return (
      <Page inner style={{ background: '#ffffff' }} >
        <div className={styles.form}>
          <div className={styles.logo}>
            <img alt={'logo'} src={config.logo} />
            <span>欢迎来到{config.name}</span>
          </div>
          <div>
            <p>
              检测到您目前没有加入任何组织，请您尽快选择加入相关组织，若您是组织
              管理人员，请尽快创建组织，谢谢！
            </p>
            
          </div>
          <div className={styles.ButtonGroup}>
            <Row>
              <Col span={12}>
                <Button type="primary" onClick={join}>加入组织</Button>
              </Col>
              <Col span={12}>
                <Button type="primary" onClick={create}>创建组织</Button>
              </Col>
            </Row>
          </div>
        </div>
      </Page>
    );
  }
}
export default connect()(Alert);
